<!doctype html>

{% import 'render.html' as render %}

<html>
  <head>
    <meta charset="utf-8" />
    <title>{{p.information.first}} {{p.information.last}}</title>
    <style>
      {% include 'bootstrap.css' %}
      {% include 'style.css' %}
    </style>
  </head>

  <body>

  <div class="container activityreport">
    <div class="header">
      {% if yearstart %}
      <h1> Annual Activity Report: {{monthstart|month}} {{yearstart}} -
      {{monthend|month}} {{yearend}} </h1>
      {% else %}
      <h1> Annual Activity Report: {{monthend|month}} {{yearend}} </h1>
      {% endif %}
      <h2>{{p.information.first}} {{p.information.last}}, {{p.information.position}}</h2>
      <h3>{{p.information.email}}</h3>
    </div>

    <h1> Research </h1>

    <h2> Publications </h2>
      {% for sec, publist in p.x_pub_type %}
      <h3> {{sec | title}} </h3>
      <ol>
        {% for x in publist %}
        <li> {{render.pub(x)}} </li>
        {% endfor %}
      </ol>
      {% endfor %}

      {% if p.x_talks %}
      <h2> Talks &amp; Lectures </h2>
      <ol>
        {% for x in p.x_talks %}
        <li>{{render.talk(x)}}</li>
        {% endfor %}
      </ol>
      {% endif %}

      {% if p.researchactivities.appliedcreativeresearch %}
      <h2> Applied &amp; Creative Research </h2>
        <ul>
        {% for x in p.researchactivities.appliedcreativeresearch %}
          <li> {{x.monthstart|month}} {{x.yearstart}} to
               {{x.monthend|month}} {{x.yearend}}.
               {{x.note|isnull}} </li>
        {% endfor %} 
        </ul>
      {% endif %}
      
      {% if p.researchactivities.otherresearch %}
      <h2> Other Research </h2>
        <ul>
        {% for x in p.researchactivities.otherresearch %}
          <li> {{x.monthstart|month}} {{x.yearstart}} to
               {{x.monthend|month}} {{x.yearend}}.
               {{x.note|isnull}} </li>
        {% endfor %} 
        </ul>
      {% endif %}

    {% if p.x_fundings %}
    <h2> Fundings </h2>
      {% for status, grants in p.x_fundings %}
        <h3> {{status}} </h3>
        {% if grants %}
        <table>
          <tr>
            <th>Title</th>
            <th>Duration</th>
            <th>Funding source</th>
            <th>Role</th>
            <th>Amount</th>
            <th>Note</th>
          </tr>
          {% for x in grants %}
          <tr> {{render.grant2(x)}} </tr>
          {% endfor %}
        </table>
        {% endif %}
      {% endfor %}
    {% endif %}

{#
    {% if p.funding.pending %}
    <h2> Funding Applied </h2>
      <ol>
      {% for x in p.funding.pending %}
        <li> {{x.monthapplied|month}} {{x.yearapplied}}, 
        {{x.title}},
        {{x.grantinginstitution}}.
        {% if x.role %} As {{x.role}}. {% endif %}
        {% if x.note %} <i>{{x.note}}</i> {% endif %}
      {% endfor %}
      </ol>
    {% endif %}
#}

    <h2> Training of Highly Qualified Personnel </h2>

    <table>
    {% for studenttype, students in p.x_students %}
        {% for x in students %}
        <tr> {{render.student(x)}} </tr>
        {% endfor %}
    {% endfor %}
    </table>

    <h1> Teaching </h1>
    
    <h2> Courses </h2>
    <table>
    {% for x in p.teaching.courses %}
      <tr>
      <td> {{x.monthsemester|month}} {{x.yearsemester}} </td>
      <td> {{x.coursecode}} </td>
      <td> {{x.coursetitle}} </td>
      </tr>
    {% endfor %}
    </table>

    <h2> Curriculum Development </h2>
    {% if p.teaching.curriculumdev %}
    <table>
      {% for x in p.teaching.curriculumdev %}
      <tr>
        <td> {{x.month|month}} {{x.year}} </td>
        <td> {{x.curriculum}} 
             {% if x.description %} <i> {{x.description}} </i> {% endif %}
        </td>
      </tr>
      {% endfor %}
    </table>
    {% else %}
    None
    {% endif %}

    <h2> Course Development </h2>
    {% if p.teaching.coursedev %}
    <table>
      {% for x in p.teaching.coursedev %}
      <tr>
      <td> {{x.month|month}} {{x.year}} </td>
      <td> {{x.coursecode}} </td>
      <td> {{x.coursetitle}} </td>
      <td> <i> {{x.description}} </i> </td>
      </tr>
      {% endfor %}
    </table>
    {% else %}
    None
    {% endif %}

    <h2> Course Evaluations </h2>
    {% if p.teaching.evaluation %}
    <table>
      <tr> <th>Semester</th>
           <th>Course</th>
           <th>Score</th>
           <th>Note</th> </tr>
      {% for x in p.teaching.evaluation %}
      <tr>
        <td>{{x.year}}/{{x.month}}</td>
        <td>{{x.coursecode}}</td>
        <td>{{x.score}}</td>
        <td>{{x.note|isnull}}</td>
      </tr>
      {% endfor %}
    </table>
    {% else %}
    None
    {% endif %}

    <h2> Teaching Related Awards and Publications </h2>
    {% if p.teaching.awardsandpublications %}
    <table>
      {% for x in p.teaching.awardsandpublications %}
      <tr>
      <td> {{x.month|month}} {{x.year}} </td>
      <td> {{x.awardorpublication}} </td>
      <td> {{x.note}} </td>
      </tr>
      {% endfor %}
    </table>
    {% else %}
    None
    {% endif %}

    <h2> Teaching Related Initiative Programs </h2>
    {% if p.teaching.initiatives %}
    <table>
      {% for x in p.teaching.initiatives %}
      <tr>
      <td> {{x.month|month}} {{x.year}} </td>
      <td> {{x.initiativeprogram}} </td>
      <td> {% if x.description %} {{x.description}} {% endif %} </td>
      </tr>
      {% endfor %}
    </table>
    {% else %}
    None
    {% endif %}

    <h1> Services </h1>
    {% for (label, services) in p.x_services %}
      <h2> {{label}} </h2>
      {% if services %}
      <table>
        <tr>
          <th > Start </th>
          <th > End </th>
          <th> Service description </th>
        </tr>
        {% for x in services %}
        <tr>
          <td> {{x.monthstart|month}} {{x.yearstart}}</td>
          <td> {{x.monthend|month}} {{x.yearend}}</td>
          <td> {{x.typeofservice}}
               {%if x.note%} Note: {{x.note}} {%endif%} </td>
        </tr>
        {% endfor %}
      </table>
      {% else %}
      None.
      {% endif %}
    {% endfor %}

  </div>

  </body>
</html>
